import { findHeadCategory } from '@/api/home'
export default {
  namespaced: true,
  state: () => ({
    // 导航分类数据
    navs: []
  }),
  mutations: {
    setNavs (state, navs) {
      state.navs = navs
    }
  },
  actions: {
    // 获取导航分类的数据
    async  getNavs ({ commit }, payload) {
      const { result } = await findHeadCategory()
      commit('setNavs', result)
    }
  }
}
